advantages of life cycle hooks